package alt.djudge.frontend.client.ui.grids;

import com.google.gwt.user.client.ui.MenuItem;

class FilterWrapper
{
	public Filter filter;
	
	private boolean enabled = true;
	
	public MenuItem menuItem;
	
	public FilterWrapper(Filter filter)
	{
		this.filter = filter;
	}
	
	public FilterWrapper(Filter filter, MenuItem menuItem)
	{
		this.filter = filter;
		this.menuItem = menuItem;
		setEnabled(false);
	}

	public boolean getEnabled()
	{
		return enabled;
	}

	public void setEnabled(boolean enabled)
	{
		if (menuItem != null)
			this.menuItem.setText((enabled ? "[+] " : "[-] ") + filter.getText());
		this.enabled = enabled;
	}	
}